﻿Imports System.Collections.Generic
Imports Pop.Api.Response
Imports Pop.Api.Util

Namespace Pop.Api.Request
    ''' <summary>
    ''' 1.08 (初级)查询单个商品详细信息
    ''' </summary>
    Public Class GetItemRequest
        Inherits PopRequest(Of GetItemResponse)

        ''' <summary>
        ''' 商品编码
        ''' </summary>
        Property ItemCode As String

        ''' <summary>
        ''' 商品私有编码
        ''' </summary>
        Property ItemLocalCode As String

        ''' <summary>
        ''' 是否需要解析商品属性
        ''' </summary>
        Property NeedParseAttr As Nullable(Of Long)

        ''' <summary>
        ''' 是否需要返回商品详情
        ''' </summary>
        Property NeedDetailInfo As Nullable(Of Long)

        ''' <summary>
        ''' 是否需要返回附加信息
        ''' </summary>
        Property NeedExtendInfo As Nullable(Of Long)

#Region "Overrides"

        Protected Overrides Function GetApiName() As String
            Return "item.getItem"
        End Function

        Protected Overrides Function GetParameters() As IEnumerable(Of KeyValuePair(Of String, String))
            Dim parameters As New PopDictionary
            parameters.Add("itemCode", Me.ItemCode)
            parameters.Add("itemLocalCode", Me.ItemLocalCode)
            parameters.Add("needParseAttr", Me.NeedParseAttr)
            parameters.Add("needDetailInfo", Me.NeedDetailInfo)
            parameters.Add("needExtendInfo", Me.NeedExtendInfo)
            Return parameters
        End Function

        Protected Overrides Sub Validate()

        End Sub

#End Region

    End Class
End Namespace